import http from '@/utils/http'

export function dictApi(data, params) {
  return http.request({
    url: '/api/dict/getAll',
    method: 'POST',
    data,
    params
  })
}

export function dictDeleteApi(_id) {
  return http.request({
    url: `/api/dict/${_id}`,
    method: 'DELETE',
  })
}

export function dictDetailApi(_id) {
  return http.request({
    url: `/api/dict/${_id}`,
    method: 'GET',
  })
}

export function dictAddApi(data) {
  return http.request({
    url: `/api/dict`,
    method: 'POST',
    data,
  })
}

export function dictUpsertApi(data) {
  return http.request({
    url: `/api/dict/${data?.id}`,
    method: 'PUT',
    data,
  })
}